package com.study.java.jinjie.jihe.ceshi;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Riqi {
    public static void main(String[] args) {
     Riqi riqi = new Riqi();
     System.out.println(riqi.dangqian());
//     riqi.shengri("张三","1998-04-25");

    }

    public String  dangqian( ){
        // 2024年03月16日 18:43:21
        Date currentDate = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 hh:mm:ss");
        String formattedDate = dateFormat.format(currentDate);
       return formattedDate;
    }
    public String shengri(String name, String ri){
        String now = dangqian();
        String nowYear = now.substring(0, 4);
        String oldYear = ri.substring(0, 4);
        int age1 = Integer.valueOf(nowYear) - Integer.valueOf(oldYear);
        System.out.println(age1);



     return " ";
    }

}
